
<!--
    qSelect Control
    Author: Timothy C. Quinn
    
    http://127.0.0.1:8100/qlibjs/webres/common/_test/qHtml/qSelectWidgetTester.html
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    	<link rel="stylesheet" title="Screen Styles" href="../../qCore.css" type="text/css" media="screen">
        <title>qSelectWidget</title>
        <script>
            imagePath='../../images/';
            wrroot='../../';
            scriptPath='';
            contextPath='';
            bIsDev=true;
            bDebug=true;
        </script>
        <script src='../../jquery_exp.js'></script> 
        <script src='../../qCore.js'></script>   
        <script src='../../qBase.js'></script>   
        <script src='../../qHtml.js'></script>
                
        <script>
        	function bodyLoaded(){
        		
        		var o, oFlt
				pc("DEBUG -	Initializing Default qClient")
				__initDefQClient()
				
//				pc("el = "+mkE({tag: "img", _id:"test", _src: "qSelectBoxBase.gif", _style: "float: right; margin-left: 2px"}))
//return

				qSW = qSelectWidget.create(
						agetElem("tfListMulti")
						,{
							rows: 4
						   ,type: qSelectWidget.TYPE_listMulti
						   ,options:[
						   		["text 1","v1",false]
						   	   ,["text 2 (big text)","v2",false]
						   	   ,["text 3","v3",true]
						   	   ,["text 4","v4",false]
						   	   ,["text 5","v5",false]
						   	   ,["text 6","v6",true]
						   ]	
						   ,cssGen: {fontSize: "70%"}
						}
						
				)
				
				qSW = qSelectWidget.create(
						agetElem("tfDD1")
						,{
							rows: 3
						   ,type: qSelectWidget.TYPE_dropDown
						   ,options:[
						   		["text 1","v1",false]
						   	   ,["text 2 (big text)","v2",false]
						   	   ,["text 3","v3",true]
						   	   ,["text 4","v4",false]
						   	   ,["text 5","v5",false]
						   	   ,["text 6","v6",true]
						   ]	
						}
				)
				o=agetElem("tfPUSingle")
				qSW = qSelectWidget.create(
						o
						,{
							rows: 7
						   ,type: qSelectWidget.TYPE_popUpSingle
						   ,options:[
						   		["January","1"]
						   	   ,["February","2"]
						   	   ,["March","3"]
						   	   ,["April","4"]
						   	   ,["May","5"]
						   	   ,["June","6"]
						   	   ,["July","7"]
						   	   ,["August","8"]
						   	   ,["September","9"]
						   	   ,["October","10"]
						   	   ,["November","11"]
						   	   ,["December","12"]
						   ]	
						   ,funcGetCurVal: function tfPUSingle_funcGetCurVal(){
						   		var oV=agetElem("hPUSingleVal");
						   		return oV.value
						   }
						   ,funcValChg: function tfPUSingle_funcValChg(opt){
						   		var sT,sV,o=agetElem("tfPUSingle"),oV=agetElem("hPUSingleVal"),opt;
						   		if(!opt){
						   			sT="(un-selected)"
						   			sV=""
						   		} else {
							   		sT=opt.text
							   		sV=opt.value
							   	}
						   		o.innerHTML=sT
						   		oV.value=sV
//pc(
//     "\n aOpts = "+s$.pad(aOpts)
//    +"\n sT = "+sT
//    +"\n sV = "+sV
//)
						   }
						}
				)
				
				o.flt=qSW.getFltElem()
				o.onclick=function tfPUSingle_click(e){e=getEvent(e)
					var o=e.target,oFlt=o.flt
//pc(
//    "\n o = "+o
//   +"\n oFlt = "+oFlt
//)					
					if(oFlt.isOpen())
						oFlt.close()
					else
						oFlt.open({parent: o, position: qHtml.POS_BL, closeDelay: 2000})				
						
				}

//pc("qSelectWidget:\n"+s$.pad(qObjDump(qSelectWidget)))
//pc("qSW:\n"+s$.pad(qObjDump(qSW)))

        	}	

        </script>
       
        
    </head>
    <body>
    	<script>
    		var h=qHtml,bModify=true
			dw (
			     "\n"+h.frmForm("fmTest")
	            +"\n"+"<div style='color: #555555; background: #ffffef; padding: 3px; border: 1px solid #999999' width=20px>"
	                +"\n"+"<img src='"+imagePath+(bModify?"sjp_mail_notice.gif":"sjp_mail_notice_new.gif")+"' height='16px' style='text-align: top'>&nbsp;&nbsp;"
	                +"\n"+"<b id='tfAnHead' style='font-size:100%; line-height: 1.5em'>qSelect Widget Tests</b>"
	                +"\n"+"<div>"
					    +"\n"+h.tblHd()
					        +"\n"+h.tblRow(
					            "\n"+h.tblCells(
					                {$c: "lbl", $h: "List Multi Select:&nbsp;"}
					               ,{$c: "att", $h: ("<span id='tfListMulti' style='margin-right: 2px'>(empty)</span><br>")}
					            )
					            ,{_style: "vertical-align: top;"}
					        )
					        +"\n"+h.tblRow(
					            "\n"+h.tblCells(
					                {$c: "lbl", $h: "Drop Down:&nbsp;"}
					               ,{$c: "att",$h: ("<span id='tfDD1' style='margin-right: 2px'>(empty)</span><br>")}
					            )
					            ,{_style: "vertical-align: top;"}
					        )
					        +"\n"+h.tblRow(
					            "\n"+h.tblCells(
					                {$c: "lbl", $h: "Pop Up Single:&nbsp;"}
					               ,{$c: "att",$h: (
					               		"<span id='tfPUSingle' style='margin-right: 2px; color: navy; cursor: pointer; cursor: hand'>March</span><br>"
					               	    +"<input type=hidden id=hPUSingleVal value='3'>"
					               	), _style: "cursor: pointer; cursor: hand"}
					            )
					            ,{_style: "vertical-align: top;"}
					        )
					   +"\n"+h.tblFt()
				   +"\n"+"<div>"
			   +"\n"+"</div>"
			   +"\n"+"</form>"
			)
			
    	</script>
    	
	<script>
        bConsole=true; __qcOpts={cb:true, t:0, w: 600, h: 500}
	    _SCR_START=" bodyLoaded();"; function __start() {try{if(bConsole){startCons(__qcOpts); _w.consoleLoaded = function consoleLoaded(){ setTimeout(_SCR_START,50) }}else{eval(_SCR_START)}}catch(e){debugErr(e)}};__start()
    </script>
	</body>
</html>
